﻿using AutoMapper;
using HuiLian.Common.HdlHttpModel;
using HuiLian.Model.Platform;
using HuiLian.Service.HdlScada.AlarmRealTime.Output;
using HuiLian.Service.Platform.Auth.Output;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuiLian.Service.HdlScada.AlarmRealTime
{
    /// <summary>
    /// 映射配置
    /// </summary>
    public class MapConfig : Profile
    {
        public MapConfig()
        {
            CreateMap<HdlScadaAlarmRealtimeResponseDataRows, HdlScadaAlarmRealtimeOutput>()
                .ForMember(d => d.station_id, m => m.MapFrom(s => s.rules[0].info.station_id))
                .ForMember(d => d.station_bm, m => m.MapFrom(s => s.rules[0].info.station_bm))
                .ForMember(d => d.station_code, m => m.MapFrom(s => s.rules[0].info.station_code))
                .ForMember(d => d.station_name, m => m.MapFrom(s => s.rules[0].info.station_name))
                .ForMember(d => d.station_address, m => m.MapFrom(s => s.rules[0].info.station_address))
                .ForMember(d => d.station_position, m => m.MapFrom(s => s.rules[0].info.station_position))
                .ForMember(d => d.station_gdposition, m => m.MapFrom(s => s.rules[0].info.station_gdposition))
                .ForMember(d => d.station_type, m => m.MapFrom(s => s.rules[0].info.station_type))
                .ForMember(d => d.station_typename, m => m.MapFrom(s => s.rules[0].info.station_typename))
                .ForMember(d => d.station_order, m => m.MapFrom(s => s.rules[0].info.station_order))
                .ForMember(d => d.sensor_id, m => m.MapFrom(s => s.rules[0].info.sensor_id))
                .ForMember(d => d.sensor_code, m => m.MapFrom(s => s.rules[0].info.sensor_code))
                .ForMember(d => d.sensor_name, m => m.MapFrom(s => s.rules[0].info.sensor_name))
                .ForMember(d => d.sensor_order, m => m.MapFrom(s => s.rules[0].info.sensor_order));
        }
    }
}
